import Vue from 'vue'
import App from './App'
import store from './store'
import Api from './api/index'
import Message from '@/pages/pagecomponents/other/message'
import CONFIG from '@/config/config.conf'
import { formatDate, formatPrice, format } from '@/utils/format'
// #ifndef H5 || APP-PLUS
import '@/lib/baidutongji/mtj-wx-sdk.js' //小程序引入百度移动统计
// #endif

Vue.config.productionTip = false

// Vuex
Vue.prototype.$store = store

// 全局api
Vue.prototype.$api = Api;

// 过滤器
Vue.prototype.formatDate = formatDate;
Vue.prototype.formatPrice = formatPrice;
Vue.prototype.format = format;

// 微信小程序胶囊按钮尺寸信息
let menuButton = 0;
// #ifndef H5 || APP-PLUS
menuButton = uni.getMenuButtonBoundingClientRect()
// #endif
Vue.prototype.menuButton = menuButton;

// 全局存储应用名
Vue.prototype.appName = CONFIG.appNameE;
Vue.prototype.appNameCNY = CONFIG.appNameC;
Vue.prototype.CONFIG = CONFIG;

// 自定义消息提示
Vue.component('message', Message)

// 默认参数
App.mpType = 'app'
const app = new Vue({
  store, // Vuex
  ...App,
})
app.$mount()
